home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Ghost 1.0 / source / Ghost ƒ / Ghost code / ghost error.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.6 KB  |  61 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        ghost error.c
  4.  
  5. Purpose:    This module handles fatal and non-fatal Ghost-specific
  6.             errors.
  7.  
  8.  
  9. Ghost -=- a classic word-building challenge
  10. Copyright (C) 1993 Mark Pilgrim
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "ghost globals.h"
  30. #include "ghost error.h"
  31. #include "msg dialogs.h"
  32. #include "msg main.h"
  33.  
  34. void HandleError(int resultCode)
  35. {
  36.     Str255            tempStr;
  37.     
  38.     if (resultCode!=allsWell)
  39.     {
  40.         GetIndString(tempStr, 129, resultCode);
  41.         ParamText(tempStr, "\p", "\p", "\p");
  42.         PositionDialog('ALRT', prefsErrorAlert);
  43.         StopAlert(prefsErrorAlert, 0L);
  44.         switch (resultCode)
  45.         {
  46.             case kNoIndex:
  47.             case kNoDictionaries:
  48.             case kCantFindSmallDict:
  49.             case kCantReadSmallDict:
  50.             case kSmallDictDamaged:
  51.             case kCantFindLargeDict:
  52.             case kCantReadLargeDict:
  53.             case kLargeDictDamaged:
  54.             case kNoMemory:
  55.                 ShutDownEnvironment();
  56.                 ExitToShell();
  57.                 break;
  58.         }
  59.     }
  60. }
  61.